Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
karma-chrome-launcher
Advanced tools
The karma-chrome-launcher npm package is a plugin for Karma, a test runner for JavaScript. It allows developers to execute tests in the Chrome browser. It can launch Chrome in various modes, control browser instances, and integrate with continuous integration systems.
Launching Chrome for testing
This feature allows you to configure Karma to use Chrome as the browser for running tests. You simply add 'Chrome' to the 'browsers' array in your Karma configuration.
module.exports = function(config) {
config.set({
browsers: ['Chrome'],
// ... other Karma configuration ...
});
};
Running tests in headless Chrome
This feature enables you to run tests in a headless Chrome instance, which is useful for continuous integration environments where you don't need a visible UI.
module.exports = function(config) {
config.set({
browsers: ['ChromeHeadless'],
// ... other Karma configuration ...
});
};
Customizing Chrome flags
This feature allows you to customize the Chrome instance by adding command-line flags to alter its behavior for testing purposes.
module.exports = function(config) {
config.set({
customLaunchers: {
Chrome_with_flags: {
base: 'Chrome',
flags: ['--disable-web-security', '--disable-gpu']
}
},
browsers: ['Chrome_with_flags'],
// ... other Karma configuration ...
});
};
This package is similar to karma-chrome-launcher but is used to launch Mozilla Firefox for running tests with Karma. It provides similar functionality for a different browser.
Similar to karma-chrome-launcher, this package allows you to run tests in the Safari browser. It is specifically tailored for Safari and provides comparable features for Karma integration.
This package is designed to launch Internet Explorer for testing with Karma. It offers similar capabilities to karma-chrome-launcher but targets the Internet Explorer browser.
karma-edge-launcher is a plugin to launch Microsoft Edge for testing with Karma. It provides similar features to karma-chrome-launcher, adapted for the Edge browser.
Launcher for Google Chrome, Google Chrome Canary and Google Chromium.
The easiest way is to keep karma-chrome-launcher
as a devDependency in your package.json
,
by running
$ npm install karma-chrome-launcher --save-dev
// karma.conf.js
module.exports = function(config) {
config.set({
browsers: ['Chrome', 'Chrome_without_security'], // You may use 'ChromeCanary', 'Chromium' or any other supported browser
// you can define custom flags
customLaunchers: {
Chrome_without_security: {
base: 'Chrome',
flags: ['--disable-web-security']
}
}
})
}
The --user-data-dir
is set to a temporary directory but can be overridden on a custom launcher as shown below.
One reason to do this is to have a permanent Chrome user data directory inside the project directory to be able to
install plugins there (e.g. JetBrains IDE Support plugin).
customLaunchers: {
Chrome_with_debugging: {
base: 'Chrome',
chromeDataDir: path.resolve(__dirname, '.chrome')
}
}
You can pass list of browsers as a CLI argument too:
$ karma start --browsers Chrome,Chrome_without_security
For more information on Karma see the homepage.
FAQs
A Karma plugin. Launcher for Chrome and Chrome Canary.
The npm package karma-chrome-launcher receives a total of 1,967,253 weekly downloads. As such, karma-chrome-launcher popularity was classified as popular.
We found that karma-chrome-launcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.